/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Classes;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author BRUNA
 */

@Entity
@Table (name="tbl_MateriaPrima")
@SequenceGenerator(name="seq_MateriaPrima",sequenceName="seq_MateriaPrima",allocationSize=1)

public class MateriaPrimaClass implements Serializable {
    @Id 
    @GeneratedValue(generator="seq_MateriaPrima", strategy= GenerationType.TABLE)
    
    private int id;
    private String descricao;
    
    @ManyToOne
    @JoinColumn(name="seq_unimed")
    
    private UniMedidaClass uniMedida;
    
    public MateriaPrimaClass(){
        
    }

    
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public UniMedidaClass getUniMedida() {
        return uniMedida;
    }

    public void setUniMedida(UniMedidaClass uniMedida) {
        this.uniMedida = uniMedida;
    }

    public MateriaPrimaClass(String descricao, UniMedidaClass uniMedida) {
        this.descricao = descricao;
        this.uniMedida = uniMedida;
    }
    
    @Override
    public String toString() {
        return (descricao);
    } 
    
}
